From 8e5846fe5bae9f62497f4802986db5e68dc68eb4 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 10 May 2006 17:30:42 +0100 Subject: [PATCH] When we copy packet sin netback/netfront make sure the new skb has all the necessary fields initialised. In particular, before we were not copying ip_summed and that screws up checksum offload. Signed-off-by: Keir Fraser --- linux-2.6-xen-sparse/drivers/xen/netback/netback.c | 3 ++- linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c index 60628ea9b4..65432c8958 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netback/netback.c +++ b/linux-2.6-xen-sparse/drivers/xen/netback/netback.c @@ -170,9 +170,10 @@ int netif_be_start_xmit(struct sk_buff *skb, struct net_device *dev) ret = skb_copy_bits(skb, -hlen, nskb->data - hlen, skb->len + hlen); BUG_ON(ret); + /* Copy only the header fields we use in this driver. */ nskb->dev = skb->dev; + nskb->ip_summed = skb->ip_summed; nskb->proto_data_valid = skb->proto_data_valid; - nskb->proto_csum_blank = skb->proto_csum_blank; dev_kfree_skb(skb); skb = nskb; } diff --git a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c index 197e34c47a..99e0a5f607 100644 --- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c +++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c @@ -665,7 +665,10 @@ static int network_start_xmit(struct sk_buff *skb, struct net_device *dev) goto drop; skb_put(nskb, skb->len); memcpy(nskb->data, skb->data, skb->len); + /* Copy only the header fields we use in this driver. */ nskb->dev = skb->dev; + nskb->ip_summed = skb->ip_summed; + nskb->proto_data_valid = skb->proto_data_valid; dev_kfree_skb(skb); skb = nskb; } @@ -898,8 +901,11 @@ static int netif_poll(struct net_device *dev, int *pbudget) skb_reserve(nskb, 2); skb_put(nskb, skb->len); memcpy(nskb->data, skb->data, skb->len); + /* Copy any other fields we already set up. */ nskb->dev = skb->dev; nskb->ip_summed = skb->ip_summed; + nskb->proto_data_valid = skb->proto_data_valid; + nskb->proto_csum_blank = skb->proto_csum_blank; } /* Reinitialise and then destroy the old skbuff. */ -- 2.30.2